package com.candy.bean;

import javax.lang.model.element.NestingKind;

/**
 * @author donglin
 * @Title:
 * @类名: Person
 * @date 2020/5/19
 */
public class Person {
    //定义属性姓名
   public String name;
   //定义属性年龄
   public int age;
   //定义属性性别
   public  boolean sex;
    //无参构造
    public Person() {
    }
    //全参构造

    public Person(String name, int age, boolean sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }
    //定义一个方法，sayHi
   public void sayHi(String name, int age, boolean sex){
       this.name=name;
       this.age=age;
       this.sex=sex;
       System.out.println("大家好,我是"+name+"今年"+age+"岁了，"+(sex?"男":"女"));
   }

    public void sayHi(){
        this.name=name;
        this.age=age;
        this.sex=sex;
        System.out.println("大家好,我是"+name+"今年"+age+"岁了，"+(sex?"男":"女"));
    }



}
